import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_author/utils/rouces_util.dart';

import '../../../config/base_configuration.dart';
import '../../../config/ui_constant.dart';

class DeleteWordDialog extends StatelessWidget {
  Function? delete;
  String deleteWord;
  String uid;

  DeleteWordDialog({Key? key, this.delete, this.deleteWord: "", this.uid: ""})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(
        top: 24.w,
      ),
      child: Column(
        children: [
          Container(
            width: Get.width,
            alignment: Alignment.center,
            padding: EdgeInsets.only(
              left: 12.w,
              right: 12.w,
            ),
            child: Text(
              "“${deleteWord}”",
              style: TextStyle(
                fontSize: 16.sp,
                color: UIConstant.colorE02020,
              ),
              textAlign: TextAlign.center,
              overflow: TextOverflow.ellipsis,
            ),
          ),
          SizedBox(
            height: 5.w,
          ),
          Container(
            alignment: Alignment.center,
            padding: EdgeInsets.only(
              left: 12.w,
              right: 12.w,
            ),
            child: Text(
              "是否删除该发言？",
              style: TextStyle(
                fontSize: 16.sp,
                color: ColorConf.normal,
              ),
              textAlign: TextAlign.center,
            ),
          ),
          SizedBox(
            height: 24.w,
          ),
          Container(
            height: 43.w,
            decoration: BoxDecoration(
              border: Border(
                top: BorderSide(
                  color: Color(0xFFEEEEEE),
                  width: 1.w,
                ),
              ),
            ),
            child: Row(
              children: [
                Expanded(
                  child: InkWell(
                    onTap: () {
                      Get.back();
                    },
                    child: Text(
                      "取消",
                      style:
                          TextStyle(fontSize: 16.sp, color: Color(0xFF666666)),
                      textAlign: TextAlign.center,
                    ),
                  ),
                ),
                Container(
                  height: 43.w,
                  width: 1.w,
                  color: Color(0xFFEEEEEE),
                ),
                Expanded(
                    child: InkWell(
                  onTap: () {
                    Get.back();
                    delete!();
                  },
                  child: Text(
                    "删除发言",
                    style: TextStyle(
                        fontSize: 16.sp,
                        color: Color(0xFFE02020),
                        fontWeight: FontWeight.w500),
                    textAlign: TextAlign.center,
                  ),
                ))
              ],
            ),
          )
        ],
      ),
    );
  }
}

//删除录播

class DeleteRecordingDialog extends StatelessWidget {
  Function? delete;
  String id;

  DeleteRecordingDialog({Key? key, this.delete, this.id: ""}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(
        top: 24.w,
      ),
      child: Column(
        children: [
          SizedBox(
            height: 5.w,
          ),
          Container(
            alignment: Alignment.center,
            padding: EdgeInsets.only(
              left: 12.w,
              right: 12.w,
            ),
            child: Text(
              "录播视频删除后不可恢复\n确定删除吗？",
              style: TextStyle(
                fontSize: 16.sp,
                color: ColorConf.normal,
              ),
              textAlign: TextAlign.center,
            ),
          ),
          SizedBox(
            height: 24.w,
          ),
          Container(
            height: 43.w,
            decoration: BoxDecoration(
              border: Border(
                top: BorderSide(
                  color: Color(0xFFEEEEEE),
                  width: 1.w,
                ),
              ),
            ),
            child: Row(
              children: [
                Expanded(
                  child: InkWell(
                    onTap: () {
                      Get.back();
                    },
                    child: Text(
                      "取消",
                      style:
                          TextStyle(fontSize: 16.sp, color: Color(0xFF666666)),
                      textAlign: TextAlign.center,
                    ),
                  ),
                ),
                Container(
                  height: 43.w,
                  width: 1.w,
                  color: Color(0xFFEEEEEE),
                ),
                Expanded(
                    child: InkWell(
                  onTap: () {
                    Get.back();
                    delete!();
                  },
                  child: Text(
                    "确定删除",
                    style: TextStyle(
                        fontSize: 16.sp,
                        color: Color(0xFFE02020),
                        fontWeight: FontWeight.w500),
                    textAlign: TextAlign.center,
                  ),
                ))
              ],
            ),
          )
        ],
      ),
    );
  }
}

///todo:举报
class ReportWordDialog extends StatelessWidget {
  Function? delete;
  String deleteWord;
  String uid;
  bool isReport;

  ReportWordDialog(
      {Key? key,
      this.delete,
      this.deleteWord: "",
      this.uid: "",
      this.isReport: false})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(
        top: 24.w,
      ),
      child: Column(
        children: [
          Container(
            width: Get.width,
            alignment: Alignment.center,
            padding: EdgeInsets.only(
              left: 12.w,
              right: 12.w,
            ),
            child: Text(
              "“${deleteWord}”",
              style: TextStyle(
                fontSize: 16.sp,
                color: UIConstant.colorE02020,
              ),
              textAlign: TextAlign.center,
              overflow: TextOverflow.ellipsis,
            ),
          ),
          SizedBox(
            height: 5.w,
          ),
          Container(
            alignment: Alignment.center,
            padding: EdgeInsets.only(
              left: 12.w,
              right: 12.w,
            ),
            child: Text(
              isReport ? "您已举报过该发言" : "是否举报该发言",
              style: TextStyle(
                fontSize: 16.sp,
                color: ColorConf.normal,
              ),
              textAlign: TextAlign.center,
            ),
          ),
          SizedBox(
            height: 24.w,
          ),
          Container(
            height: 43.w,
            decoration: BoxDecoration(
              border: Border(
                top: BorderSide(
                  color: Color(0xFFEEEEEE),
                  width: 1.w,
                ),
              ),
            ),
            child: Row(
              children: isReport
                  ? [
                      Expanded(
                        child: InkWell(
                          onTap: () {
                            Get.back();
                          },
                          child: Text(
                            "知道了",
                            style: TextStyle(
                                fontSize: 16.sp, color: Color(0xFFFEBA07)),
                            textAlign: TextAlign.center,
                          ),
                        ),
                      ),
                    ]
                  : [
                      Expanded(
                        child: InkWell(
                          onTap: () {
                            Get.back();
                          },
                          child: Text(
                            "取消",
                            style: TextStyle(
                                fontSize: 16.sp, color: Color(0xFF666666)),
                            textAlign: TextAlign.center,
                          ),
                        ),
                      ),
                      Container(
                        height: 43.w,
                        width: 1.w,
                        color: Color(0xFFEEEEEE),
                      ),
                      Expanded(
                        child: InkWell(
                          onTap: () {
                            Get.back();
                            delete!();
                          },
                          child: Row(
                            mainAxisAlignment: MainAxisAlignment.center,
                            children: [
                              RoucesUtil.getAssetsIcon("ic_report_lt", 20.w),
                              SizedBox(
                                width: 5.w,
                              ),
                              Text(
                                "举报",
                                style: TextStyle(
                                    fontSize: 16.sp,
                                    color: Color(0xFFE02020),
                                    fontWeight: FontWeight.w500),
                                textAlign: TextAlign.center,
                              ),
                            ],
                          ),
                        ),
                      )
                    ],
            ),
          )
        ],
      ),
    );
  }
}
